summaryrefslogtreecommitdiff
path: root/src/pages/posts/[slug].astro
diff options
context:
space:
mode:
authorMatt Kosarek <matt.kosarek@canonical.com>2026-03-11 17:49:05 -0400
committerMatt Kosarek <matt.kosarek@canonical.com>2026-03-11 17:49:05 -0400
commit77b0f69d0c6e555349dd491d7ca209924d119e61 (patch)
tree095cf20002f5df752c04c20af4366588bd7ba32b /src/pages/posts/[slug].astro
parentc929a29c728c6799a3f83f5ad5c1c6f99ed516d4 (diff)
Migrate to astroHEADmaster
Diffstat (limited to 'src/pages/posts/[slug].astro')
-rw-r--r--src/pages/posts/[slug].astro19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro
new file mode 100644
index 0000000..0f29ec5
--- /dev/null
+++ b/src/pages/posts/[slug].astro
@@ -0,0 +1,19 @@
+---
+import { getCollection, type CollectionEntry } from 'astro:content';
+import PostLayout from '../../layouts/PostLayout.astro';
+
+export async function getStaticPaths() {
+ const posts = await getCollection('posts');
+ return posts.map((post: CollectionEntry<'posts'>) => ({
+ params: { slug: post.slug },
+ props: { post },
+ }));
+}
+
+const { post } = Astro.props as { post: CollectionEntry<'posts'> };
+const { Content } = await post.render();
+---
+
+<PostLayout title={post.data.title}>
+ <Content />
+</PostLayout>